<html>
<head><meta charset="utf-8"><title>NodeId assignment · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html">NodeId assignment</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="177103191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/NodeId%20assignment/near/177103191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html#177103191">(Oct 01 2019 at 22:23)</a>:</h4>
<p>I just discovered that the compiler doesn't assign NodeIds during parsing -- it instead fills every node with a <code>DUMMY_NODE_ID</code>. When are the IDs properly assigned to the AST nodes?</p>



<a name="177107376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/NodeId%20assignment/near/177107376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html#177107376">(Oct 01 2019 at 23:21)</a>:</h4>
<p>the comments say something about a "renumbering" pass, but I couldn't find it anywhere in the compiler</p>



<a name="177107381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/NodeId%20assignment/near/177107381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html#177107381">(Oct 01 2019 at 23:21)</a>:</h4>
<p>maybe it's named something else?</p>



<a name="177126691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/NodeId%20assignment/near/177126691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html#177126691">(Oct 02 2019 at 07:09)</a>:</h4>
<p>It happens during macro expansion. If I remember correctly, statements get assigned ids <a href="https://github.com/rust-lang/rust/blob/590ae0ec4d0c782f7cf97cff7474dc4012c1b615/src/libsyntax/ext/placeholders.rs#L333" target="_blank" title="https://github.com/rust-lang/rust/blob/590ae0ec4d0c782f7cf97cff7474dc4012c1b615/src/libsyntax/ext/placeholders.rs#L333">here</a> and <a href="https://github.com/rust-lang/rust/blob/702b45e409495a41afcccbe87a251a692b0cefab/src/libsyntax/ext/expand.rs#L1540" target="_blank" title="https://github.com/rust-lang/rust/blob/702b45e409495a41afcccbe87a251a692b0cefab/src/libsyntax/ext/expand.rs#L1540">everything else here</a>.</p>



<a name="177126695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/NodeId%20assignment/near/177126695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/NodeId.20assignment.html#177126695">(Oct 02 2019 at 07:09)</a>:</h4>
<p>(also consider using <a class="stream" data-stream-id="182449" href="/#narrow/stream/182449-t-compiler.2Fhelp">#t-compiler/help</a>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>